package e_batchDemo;

import b_utils.JDBCUtils;

import java.sql.*;

public class batchDemo {
    public static void main(String[] args) {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            conn = JDBCUtils.getConnection();
            String sql = "insert into user values(null,?,?,?)";
            ps = conn.prepareStatement(sql);
            for (int i = 1; i <= 10; i++) {
                ps.setString(1,"user"+i);
                ps.setString(2,"aaaa");
                ps.setDate(3,new Date(1999-11-12));
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}